package com.gxuwz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.gxuwz.dao.impl.BaseDaoImpl;
import com.gxuwz.dao.impl.EquipmentDaoImpl;
import com.gxuwz.entity.SysEquipment;
import com.gxuwz.service.IEquipmentService;

@Service("equipmentService")
public class EquipmentServiceImpl extends BaseServiceImpl<SysEquipment> implements IEquipmentService{

	EquipmentDaoImpl equipmentDao;
	
	@Override
    @Autowired(required = true)
    @Qualifier("equipmentDao")
	public void setBaseDao(BaseDaoImpl<SysEquipment> baseDao) {
        this.baseDao = baseDao;
        this.equipmentDao = (EquipmentDaoImpl) baseDao;	
		
	}

	@Override
	public List<SysEquipment> findEquipByLabId(int id) {
		List<SysEquipment> equipments = equipmentDao.list(
				"from SysEquipment WHERE lab_id = ?", id);
		return equipments;
	}

}
